/**
 *	Implementation of methods of Python adapter to faif::ml::Classifier::AttrDomain class
 */

#pragma once
#include <boost/python.hpp>
#include "boost/python/detail/wrap_python.hpp"
#include <faif/learning/DecisionTree.hpp>
#include "zprDecisionTree.hpp"

#include "valueNominalWrapper.hpp"
#include "typedefs.hpp"
#include "domainenumeratewrapper.hpp"

using namespace boost::python;

template<typename T>
ZPRAttrDomain<T>::ZPRAttrDomain(const DTC::AttrIdd& attr) : attrDomain_(attr)
{

}

template<typename T>
const typename T::Value& ZPRAttrDomain<T>::get() const
{
	return attrDomain_->get();
}

template<typename T>
const typename T::DomainType& ZPRAttrDomain<T>::getDomain() const
{
	return *attrDomain_->getDomain();
}

template<typename T>
const ZPRAttrDomain<T>& ZPRAttrDomain<T>::getUnknown()
{
	return attrDomain_->getUnknown();
}

template<typename T>
bool ZPRAttrDomain<T>::isUnknown() const
{
	return attrDomain_->isUnknown();
}

template<typename T>
ZPRAttrDomain<T>::~ZPRAttrDomain(void)
{
}

template<typename Type>
PyObject* ZPRAttrDomainWrapper<Type>::convert( ZPRAttrDomain<faif::ValueNominal<Type> > const& rv)
{
	//TODO: write, using isUnknown itp...
	return incref(object( boost::python::make_tuple(rv.get(),
													rv.getDomain())).ptr());
}
